package org.microdream.easy.deploy.action;

import javax.annotation.Resource;

import org.microdream.easy.deploy.po.CachePo;
import org.microdream.easy.deploy.service.DDictionaryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;

import ice.server.comm.BaseAction;

@RestController
@RequestMapping("/dic")
public class DDictionaryAction extends BaseAction {

    @Resource
    private DDictionaryService dDictionaryService;

    /**
     * 根据类型返回字典的key-value集合
     * @param type 字典类型
     * */
    @GetMapping("searchByType/{type}")
    public JSONArray searchByType(@PathVariable("type") String type){
        return CachePo.getValues(type,"","");
    }
}
